using UnityEngine;

public class PlayerState_跳跃 : PlayerStateBase
{
	private float _MaxTimer;

	public bool _Is继续轻攻击;

	public bool _Is继续重攻击;

	public PlayerState_跳跃()
	{
		_Data_Player招式_系数 = MonoSingleton<MyDataManager>.Instance._Data_玩家招式._跳跃;
	}

	public override void OnEnter()
	{
		_Mono._可以受击 = false;
		_Mono._Ani.Play("跳跃");
		_Timer = _Mono._Dict_AniName_time["跳跃"];
		_MaxTimer = _Timer - 0.1f;
		Debug.LogError($"跳跃Timner<<{_Timer}");
		Debug.LogError($"跳跃_MaxTimerr<<{_MaxTimer}");
		_Mono._Curr气力 -= _Data_Player招式_系数._气力消耗;
		MonoSingleton<AudioManager>.Instance.F_Play_SFX(_Mono._AudioC_跳跃);
		_Is继续轻攻击 = false;
		_Is继续重攻击 = false;
	}

	public override void OnExit()
	{
		_Mono._可以受击 = true;
	}

	public override void OnUpdate()
	{
		_Mono.F_PlayerMove(5f, can转向: false);
		_Timer -= Time.deltaTime;
		if (Input.GetKeyDown(KeyCode.J))
		{
			_Is继续轻攻击 = true;
			_Is继续重攻击 = false;
		}
		else if (Input.GetKeyDown(KeyCode.K))
		{
			_Is继续轻攻击 = false;
			_Is继续重攻击 = true;
		}
		if (_Timer > 0.1f && _Timer < _MaxTimer)
		{
			if (_Is继续轻攻击)
			{
				F_轻攻击();
			}
			else if (_Is继续重攻击)
			{
				F_重攻击Down();
			}
		}
		if (_Timer <= 0f)
		{
			_Mono.ChangeState(StateType_Player.正常移动);
		}
	}

	public override void F_轻攻击()
	{
		_Mono.ChangeToState(StateType_Player.跳跃重击);
	}

	public override void F_重攻击Down()
	{
		_Mono.ChangeToState(StateType_Player.跳跃重击);
	}
}
